const { createWebAPIRequest } = require('../utils/util')

module.exports = class SearchProxy {
  static async search (limit, offset, keywords, cookie) {
    const type = 1
    const data = {
      csrf_token: '',
      limit,
      type,
      s: keywords,
      offset
    }
    const result = await createWebAPIRequest(
      'music.163.com',
      '/weapi/search/get',
      'POST',
      data,
      cookie
    )
    return result
  }
}
